import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int[] nums = new int[num];
        for (int i = 0; i < num; i++) {
            nums[i] = scan.nextInt();
        }

        int[] dp = new int[num];
        dp[0] = nums[0];

        for (int i = 1; i < dp.length; i++) {
            dp[i] = Math.max(nums[i],dp[i - 1] + nums[i]);
        }
        for (int i = 0; i < dp.length; i++) {
            System.out.println(dp[i]);
        }
    }
}